import request from '~/utils/resquest'

// 获取配电设施列表
export const getPowerDistributionFacilitiesList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/list',
    method: 'get',
    params
  })

// 导出除配电设施项
export const exportPowerDistributionFacilitiesInfo = <T>(payload: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/export',
    method: 'get',
    responseType: 'blob',
    ...payload
  })

// 获取配电设施项基础资料
export const getPowerDistributionFacilitiesInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/view',
    method: 'get',
    params
  })

// 添加配电设施项基础资料
export const addPowerDistributionFacilitiesInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/add',
    method: 'post',
    data: params
  })

// 修改配电设施项基础资料
export const updatePowerDistributionFacilitiesInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/update',
    method: 'post',
    data: params
  })

// 修改配电设施项地图位置
export const updatePowerDistributionFacilitiesMapLocation = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/updateAddress',
    method: 'post',
    data: params
  })

// 校验配电设施是否可删除
export const checkDeletedPowerDistributionFacilitiesInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/checkRemove',
    method: 'post',
    params
  })

// 删除配电设施项
export const deletePowerDistributionFacilitiesInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/remove',
    method: 'post',
    params
  })

// 获取设备类别下拉列表
export const getNodeByParentCode = <T>(params: T) =>
  request({
    url: '/api/gxsaas-monitor/deviceCategory/getNodeByParentCode',
    method: 'get',
    params
  })

// 查询配电设施
export const getDistributionSelectBoxList = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/selectBoxList',
    method: 'get',
    params
  })

// 保存配电设施回路
export const savePowerDistributionFacilitiesLoop = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distributionloop/batchSave',
    method: 'post',
    data: params
  })

// 查询配电设施是否可删除
export const getWhetherDeletePowerDistributionFacilitiesLoop = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distributionloop/checkLoopDelete',
    method: 'get',
    params
  })

// 根据配电设施id查询关联回路及回路关联灯杆和灯的信息
export const getAssociativeLoopInfoByDistributionId = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/getLoopLampNum',
    method: 'get',
    params
  })

// 配电设施导入文件
export const importPowerDistributionFacilitiesInfo = <T>(params: T) =>
  request({
    url: '/api/gxsaas-assets/distribution/import-excel-new',
    method: 'post',
    data: params
  })

// 配电设备类型
export const tenantDictDictionaryGet = <T>(params: T) =>
  request({
    url: '/api/gxsaas-system/tenantDict/dictionary',
    method: 'get',
    params
  })
